package edu.ustb.test;

import java.util.ArrayList;
import java.util.List;


public class FilterChain {
	
	List<Filter> filters  =  new ArrayList<Filter>();
	
	public String doFilter(String str) {
		String s = str;
		for (Filter filter : filters) {
			s = filter.doFilter(s);
		}
		return s;
	}
	
	public FilterChain addFilter(Filter filter) {
		filters.add(filter);
		return this;
	}
	
}
